<?php
//选号小程序的配置信息
return [
    'wxMini' => [
//        'officialAppid' => 'wx948eab2021f45cfb',
        'appid' => 'wx48bb72f0c57944ca',
        'secret' => '9982c3d59f8fce7811b189a02be74bc8',
        // 以下为支付配置
        // 商户号
        'merchantId' => '1607154880',
        //APIv3密钥
        'apiv3Key' => 'a86f149a467177b665fbaa9d58dd55db',
        // 证书序列号,v3生成微信支付平台证书使用
        'serial' => '4E1C5E0DF31519229485E67C4463EF27E7CE4783',
        // 商户私钥，文件路径假定为 `/path/to/merchant/apiclient_key.pem`
        'merchantPrivateKeyFilePath' => app()->basePath() . '/cert/1607154880/apiclient_key.pem',
        // 商户证书，文件路径假定为 `/path/to/merchant/apiclient_cert.pem`
        'merchantCertificateFilePath' => app()->basePath() . '/cert/1607154880/apiclient_cert.pem',
        // 微信支付平台证书,自己生成的,参考https://blog.csdn.net/Logical_storm/article/details/123797074
        'v3CertificateFilePath' => app()->basePath() . '/cert/1607154880/wechatpay_5FC9AF8D41AB3D04B27C03A21B5090750A764376.pem',
        'notifyUrl' => 'https://card.qqinfor.com/api/xh/pay/notify',
        'refundNotifyUrl' => 'https://card.qqinfor.com/api/xh/pay/notifyRefunds',
    ],
    'payResultStatus' => [
        0 => '支付失败',
        1 => '支付成功',
        20 => '申请退款成功',
        21 => '申请退款关闭',
        22 => '申请退款处理中',
        23 => '申请退款异常',
        24 => '退款完成'
    ],
//    前端tab与我的里的订单列表内容
    'ordersTypeList' => [
        ['page' => 'pages/orders/index?type=0', 'type' => 0, 'name' => '全部', 'iconClass' => 'icon icon-allOrder'],
        ['page' => 'pages/orders/index?type=1', 'type' => 1, 'name' => '待处理', 'iconClass' => 'icon icon-pending'],
        ['page' => 'pages/orders/index?type=2', 'type' => 2, 'name' => '待收货', 'iconClass' => 'icon icon-received'],
        ['page' => 'pages/orders/index?type=3', 'type' => 3, 'name' => '已完成', 'iconClass' => 'icon icon-complete'],
        ['page' => 'pages/orders/index?type=4', 'type' => 4, 'name' => '已取消', 'iconClass' => 'icon icon-cancel'],
    ],
    'switchStatus' => [
        0 => '启用', 1 => '停用'
    ],
    //    轮播图片显示哪个位置说明
    'swiperPosition' => [
        0 => '首页(700x350)',
    ],
//    广告图片显示哪个位置说明
    'adPosition' => [
        0 => '首页横图(700x146)',
        1 => '首页弹窗(640x640)'
    ],
    'questionType' => [
        0 => '套餐问题',
        1 => '号码相关',
        2 => '交易问题',
        3 => '支付问题',
        4 => '其它问题'
    ],
    'listType' => [
        0 => '列表号码', 1 => '列表商品', 2 => '商品详情'
    ],
//    定义的一些号码规则,symbol与查询时相关
    'ruleType' => [
        ['group' => '豹子号', 'symbol' => ['AAAABBBB', 'ABCDABCD', 'AAABBB', 'AAA*BBB', 'AABBB', 'AAAAB', 'AAA', 'AAAA', 'AAAAA', 'AAAAAA']],
        ['group' => '对子号', 'symbol' => ['ABAB', 'ABBA', 'AABB', 'ABBACC', 'AABCC']],
        ['group' => '顺序号', 'symbol' => ['ABC', 'ABCD', 'DCBA', 'ABCDE', 'EDCBA']],
        ['group' => '对称号', 'symbol' => ['ABCABC', 'ABCDDCBA']],
        ['group' => '小靓号', 'symbol' => ['AA', '1688', '1314', '521', '520', '888', '777', '666', '333', '222', '111', 'A*A*A*A', 'AB**AB', 'ABBACC', '不带4和7']],
    ],
//    接口支持的规则
    'apiSymbol' => ['AAAAA', 'AAAA', 'ABCDE', 'ABCD', 'AAA', 'AABB', 'ABAB', 'ABC', 'AA'],
//    查询的sql,从后向前找,substr函数mysql是从1开始的
    'sqlSymbol' => [
        'AAAABBBB' => '(t10!=t6 and REPEAT(t10,4)=SUBSTR(number,8,4) and REPEAT(t6,4)=SUBSTR(number,4,4))',
        'ABCDABCD' => '(ABS(RIGHT(number,4-1)*1-LEFT(RIGHT(number,4),4-1)*1)=REPEAT(1,4-1) AND SUBSTR(number,8,4)=SUBSTR(number,4,4))',
        'A*A*A*A' => '(t10=t8 AND t8=t6 AND t6=t4 AND t10!=t9 AND t8!=t7 AND t6!=t5)',
        'AB**AB' => '(t10=t6 AND t9=t5 AND t10!=t9 AND t9!=t8)',
        'AAA*BBB' => '(t10=t9 AND t9=t8 AND t6=t5 AND t5=t4 AND t10!=t6)',
        'AAAAAA' => '(REPEAT(t10,6)=RIGHT(number,6))',
        'AAAAA' => '(REPEAT(t10,5)=RIGHT(number,5) OR REPEAT(t5,5)=SUBSTR(number,6,5) OR REPEAT(t4,5)=SUBSTR(number,5,5) OR REPEAT(t3,5)=SUBSTR(number,4,5))',
        'AAAA' => '(REPEAT(t10,4)=RIGHT(number,4) OR REPEAT(t6,4)=SUBSTR(number,7,4) OR REPEAT(t5,4)=SUBSTR(number,6,4) OR REPEAT(t4,4)=SUBSTR(number,5,4) OR REPEAT(t3,4)=SUBSTR(number,4,4))',
        'ABCDE' => '(t10=(t9+1) AND t9=(t8+1) AND t8=(t7+1) AND t7=(t6+1))',
        'EDCBA' => '(t9=(t10-1) AND t8=(t9-1) AND t7=(t8-1) AND t6=(t7-1))',
        'ABCD' => '(t10=(t9+1) AND t9=(t8+1) AND t8=(t7+1))',
        'DCBA' => '(t9=(t10-1) AND t8=(t9-1) AND t7=(t8-1))',
        'AAABBB' => '((t10!=t7 and REPEAT(t10,3)=SUBSTR(number,9,3) and REPEAT(t7,3)=SUBSTR(number,6,3)) OR (t9!=t6 and REPEAT(t9,3)=SUBSTR(number,8,3) and REPEAT(t6,3)=SUBSTR(number,5,3)) OR (t8!=t5 and REPEAT(t8,3)=SUBSTR(number,7,3) and REPEAT(t5,3)=SUBSTR(number,4,3)) OR (t7!=t4 and REPEAT(t7,3)=SUBSTR(number,6,3) and REPEAT(t4,3)=SUBSTR(number,3,3)))',
        'ABBABB' => '(t10!=t9 and t10=t7 and t9=t8 and t8=t6 and t6=t5)',
        'AABAAB' => '(t10=t9 and t10=t7 and t7=t6 and t5=t8 and t10!=t8)',
        'AABCC' => '(t10=t9 and t7=t6 and t8!=t9 and t8!=t7)',
        'AABBB' => '(t10=t9 and t8=t7 and t6=t7 and t10!=t6)',
        'AAAAB' => '(REPEAT(t9,4)=SUBSTR(number,7,4) and t10=(t9+1))',
        'AAA' => '(REPEAT(t10,3)=RIGHT(number,3) OR REPEAT(t8,3)=SUBSTR(number,9,3) OR REPEAT(t7,3)=SUBSTR(number,8,3) OR REPEAT(t6,3)=SUBSTR(number,7,3) OR REPEAT(t5,3)=SUBSTR(number,6,3) OR REPEAT(t4,3)=SUBSTR(number,5,3) OR REPEAT(t3,3)=SUBSTR(number,4,3))',
        'AABB' => '((t10=t9 AND t8=t7 AND t10!=t8) OR (t9=t8 AND t7=t6 AND t9!=t7) OR (t8=t7 AND t6=t5 AND t8!=t6) OR (t7=t6 AND t5=t4 AND t7!=t5))',
        'ABAB' => '((t10=t8 AND t9=t7 AND t10!=t9) OR (t9=t7 AND t8=t6 AND t9!=t8) OR (t8=t6 AND t7=t5 AND t8!=t7) OR (t7=t5 AND t6=t4 AND t7!=t6))',
        'ABBA' => '((t10=t7 AND t9=t8) OR (t9=t6 AND t8=t7) OR (t8=t5 AND t7=t6))',
        'ABABAB' => '(t10=t8 AND t8=t6 AND t9=t7 and t7=t5  AND t10!=t9)',
        'ABBACC' => '((t10=t7 AND t9=t8 AND t6=t5 AND t10!=t9 AND t9!=t6))',
        'ABCABC' => '(t10=(t9+1) AND t9=(t8+1) AND SUBSTR(number,9,3)=SUBSTR(number,5,3))',
        'ABCCBA' => '(t10=(t9+1) AND t9=(t8+1) AND t7=t8 AND t6=t9 AND t5=t10)',
        'ABC' => '((t10=(t9+1) AND t9=(t8+1)) OR (t9=(t8+1) AND t9=(t7+1)) OR (t8=(t7+1) AND t8=(t6+1)) OR (t7=(t6+1) AND t7=(t5+1)) OR (t6=(t5+1) AND t6=(t4+1)) OR (t5=(t4+1) AND t5=(t3+1)))',
        'CBA' => '(t9=(t10-1) AND t8=(t9-1))',
        'AA' => '(REPEAT(t10,2)=RIGHT(number,2))',
        '88尾' => '(t10=t9 AND t10=8)',
        '99尾' => '(t10=t9 AND t10=9)',
        '66尾' => '(t10=t9 AND t10=6)',
        '55尾' => '(t10=t9 AND t10=5)',
        '33尾' => '(t10=t9 AND t10=3)',
        '22尾' => '(t10=t9 AND t10=2)',
        '11尾' => '(t10=t9 AND t10=1)',
        '不带4和7' => '((t10!=4 AND t9!=4 AND t8!=4 AND t7!=4 AND t6!=4 AND t5!=4 AND t4!=4 AND t3!=4 AND t2!=4 AND t1!=4) and (t10!=7 AND t9!=7 AND t8!=7 AND t7!=7 AND t6!=7 AND t5!=7 AND t4!=7 AND t3!=7 AND t2!=7 AND t1!=7))',
    ],
//    规则正则定义,由长到短,symbol指定规则定义
    'ruleRegexp' => [
        'AAAABBBB' => "([\\d])\\1{3}([\\d])\\2{3,}",
        'ABCDABCD' => "([\\d])([\\d])([\\d])([\\d])\\1\\2\\3\\4",
        'A*A*A*A' => "([\\d])[\\d]{1}\\1[\\d]{1}\\1[\\d]{1}\\1",
        'AB**AB' => "([\\d])([\\d])([\\d]{2})\\1\\2",
        'AAA*BBB' => "([\\d])\\1{2}([\d]?)([\\d])\\3{2}",
        'AAABBB' => "(\\d)\\1{2}(\\d)\\2{2}",
        'ABBABB' => "(\\d)(\\d)\\2\\1\\2\\2",
        'ABCABC' => "(\\d)(\\d)(\\d)\\1\\2\\3",
        'ABCCBA' => "(\\d)(\\d)(\\d)\\3\\2\\1",
        'AABAAB' => "(\\d)\\1(\\d)\\1\\1\\2",
        'ABBACC' => "(\\d)(\\d)\\2\\1(\\d)\\3",
        'ABCDE' => "(?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)){4,}\\d",
        'EDCBA' => "(?:9(?=8)|8(?=7)|7(?=6)|6(?=5)|5(?=4)|4(?=3)|3(?=2)|2(?=1)|1(?=0)){4}\\d",
        'AABCC' => "(\\d)\\1(\\d)(\\d)\\3{1}",
        'AABBB' => "(\\d)\\1(\\d)\\2{2}",
        'AAAAB' => "(\\d)\\1{3}(\\d)",
        'AAAAAA' => "([\\d])\\1{5,}",
        'AAAAA' => "([\\d])\\1{4,}",
        'AAAA' => "([\\d])\\1{3,}",
        'AAA' => "([\\d])\\1{2,}",
        'AA' => "([\\d])\\1$",
        'ABAB' => "(\\d)(\\d)\\1\\2",
        'ABBA' => "(\\d)(\\d)\\2\\1",
        'AABB' => "(\\d)\\1(\\d)\\2",
        'ABCD' => "(?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)){3,}\\d",
        'DCBA' => "(?:9(?=8)|8(?=7)|7(?=6)|6(?=5)|5(?=4)|4(?=3)|3(?=2)|2(?=1)|1(?=0)){3}\\d",
        '88尾' => "([8]{2,})$",
        '99尾' => "([9]{2,})$",
        '66尾' => "([6]{2,})$",
        '55尾' => "([5]{2,})$",
        '33尾' => "([3]{2,})$",
        '22尾' => "([2]{2,})$",
        '11尾' => "([1]{2,})$",
        '生日号' => "(19|20)[\\d]{2}(1[0-2]|0?[1-9])(31|2[0-9]|1[0-9]|0?[0-9])",
        '老号码' => "(13[0-9]|15[0-9]|18[0-9])([\\d]{2,4}){2}",
        '年份号' => "\\d{7}((19[5-9][0-9])|(20[0-1][0-9]))",
        '不带4和7' => "(0|1|2|3|5|6|8|9){11}",
        '1688' => "1688",
        '1314' => "1314", '521' => "521", '520' => "520", '888' => "888", '777' => "777", '666' => "666", '333' => "333", '222' => "222", '111' => "111",
    ],
//    有费用的规则号码
    'ruleNotFree' => [
        'AAAABBBB' => 1,
        'ABCDABCD' => 1,
        'AAAAAA' => 1,
        'AAAAA' => 1,
        'AAAA' => 1
    ]
];
